import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.Random;

public class 上机02生成数据 {
    public static void main(String[] args) {
        File file = new File("in/02.txt");
        try {
            BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file));
            DecimalFormat df = new DecimalFormat("#.00");
            for (int i = 1;i <= 100000; i++){
                Random random = new Random();
                bufferedWriter.write(
                        ""+i+","+(random.nextBoolean() ? "F" : "M")+","+df.format(100*random.nextGaussian()+500)+'\n'
                );
            }
            bufferedWriter.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }

    public static String generatePerson(int no){
        Random random = new Random();
        String gender = random.nextBoolean() ? "F" : "M";
        int amount = random.nextInt(10000);
        return ""+no+","+gender+","+amount;
    }
}
